import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
    // base: '/front/',
    routes: [
        {
            path: '/',
            name: '主页',
            component: () => import('../components/index'),
            redirect: '/index_index',
            children: [
                {
                    path: '/index_index',
                    name: '主页内容',
                    component: () => import('../components/index_index')
                },
                {
                    path: '/list',
                    name: '项目列表',
                    component: () => import('../components/list')
                },
                {
                    path: '/content',
                    name: '内容',
                    component: () => import('../components/content')
                },
                {
                    path: '/pdf',
                    name: 'pdf预览',
                    component: () => import('../components/content_yulan')
                },
                {
                    path: '/video',
                    name: '视频列表',
                    component: () => import('../components/video_list')
                },
                {
                    path: '/video_content',
                    name: '视频',
                    component: () => import('../components/video_content')
                },
                {
                    path: '/publish_statistics',
                    name: '发布统计排行',
                    component: () => import('../components/publish_statistics')
                },
                {
                    path: '/visit_statistics',
                    name: '访问排行',
                    component: () => import('../components/visit_statistics')
                },
                {
                    path: '/hot_statistics',
                    name: '热点稿件排行',
                    component: () => import('../components/visit_statistics_hot')
                },
                {
                    path: '/depart_publish_list',
                    name: '部门发布列表',
                    component: () => import('../components/depart_publish_list')
                }
            ]
        }
    ]
})
